<template>
    <el-form :model="form" label-width="auto" style="max-width: 600px">
        <el-form-item label="用户名称">
            <el-input v-model="form.loginAccount" />
        </el-form-item>
        <el-form-item label="手机号">
            <el-input v-model="form.phoneNo" />
        </el-form-item>
        <el-form-item label="邮箱">
            <el-input v-model="form.email" />
        </el-form-item>
        <el-form-item label="地址">
            <el-input v-model="form.addr" />
        </el-form-item>
        <el-form-item label="备注">
            <el-input v-model="form.remark" />
        </el-form-item>

        <el-form-item>
            <el-button type="primary" @click="updateuser">确认修改</el-button>
        </el-form-item>
    </el-form>
</template>

<script lang="ts" setup>
import { reactive, onMounted } from 'vue'
import { ElMessage } from 'element-plus'
import { useRouter } from 'vue-router'
import { useCounterStore } from '@/stores/counter'
import read from '@/dwrapper/axioswrapper'
const router = useRouter()
const store = useCounterStore()

// do not use same name with ref
const form = reactive({
    sysUser: 0,
    loginAccount: '',
    phoneNo: '',
    email: '',
    addr: '',
    remark: '',
})

const updateuser = () => {
    read.post('', form).then(res => {
        if (res.data.code == 3300) {
            ElMessage.success(res.data.message)

        } else {
            ElMessage.error(res.data.message)
        }
    })
}


</script>
